Skip to content

Conversation

@ovcharenko-di
Copy link
Contributor

@ovcharenko-di ovcharenko-di commented Dec 5, 2022

Описание

Новая версия bsl-parser корректно разбирает SDBL, содержащие обращения к внешним источникам данных.
В bsl-language-server добавлена зависимость от этой версии, а в сам проект добавлены соответствующие позитивные и негативные тесты.

Ожидаю, когда изменения по PR 1c-syntax/bsl-parser#219 попадут в develop, после чего в текущем PR заменю версию парсера на "официальную".

Связанные задачи

Closes #2282

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Проверка существования таблиц, кубов, таблиц измерений и их таблиц пока не реализована. Проверяется только существование самих внешних источников данных.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced detection of missing metadata references in queries, now identifying additional diagnostic issues related to non-existent metadata sources.
  • Tests

    • Updated test expectations to reflect improved diagnostic detection capabilities.

✏️ Tip: You can customize this high-level summary in your review settings.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@theshadowco
Copy link
Member

@ovcharenko-di
Добьешь? :)

@ovcharenko-di
Copy link
Contributor Author

@theshadowco вспомнить бы, чего там осталось сделать

Судя по всему, осталось научить диагностику работать с таблицами, кубами, таблицами измерений и тд. И вот с ними как раз была какая-то засада, по-моему, связанная с mdclasses

Не гарантирую, что смогу снова погрузиться в ближайшее время, но попробую это сделать

@nixel2007
Copy link
Member

Можно для начала тесты долить

@theshadowco
Copy link
Member

@ovcharenko-di
летом я вроде все от ВИД дотащил

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Walkthrough

A test file for the QueryToMissingMetadata diagnostic was updated to expect four diagnostics instead of two. The test now anticipates two additional diagnostics for a non-existent metadata reference "ВнешнийИсточникДанных.ВнешнийИсточникДанных2" with corresponding range duplications.

Changes

Cohort / File(s) Change Summary
Test Expectation Update
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
Updated expected diagnostic count from 2 to 4; added two new diagnostics for the same non-existent metadata reference at different ranges

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single test file with straightforward assertion count change (2 → 4)
  • Verify the two new diagnostics are legitimate detections for the non-existent metadata reference

Poem

🐰 Two diagnostics have grown to four,
A false positive knocks no more!
The test now knows what's really there—
External sources, caught with care. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is in Russian (DRAFT). It mentions 'Query parsing to external data sources' and 'new tests in bsl-language-server', which aligns with the changeset that updates test expectations for query diagnostics related to external data sources.
Linked Issues check ✅ Passed The PR addresses issue #2282 by fixing the QueryToMissingMetadata diagnostic to correctly handle external data sources (ВИД). The code change updates test expectations for non-existent metadata references in queries, which directly supports the diagnostic fix.
Out of Scope Changes check ✅ Passed The changes are limited to updating test expectations in QueryToMissingMetadataDiagnosticTest, which is directly related to fixing the false positive issue with external data sources in issue #2282.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7da36e3 and 293e844.

⛔ Files ignored due to path filters (4)
  • src/test/resources/diagnostics/QueryToMissingMetadataDiagnostic.bsl is excluded by !src/test/resources/**
  • src/test/resources/metadata/designer/Configuration.xml is excluded by !src/test/resources/**
  • src/test/resources/metadata/designer/ExternalDataSources/ВнешнийИсточникДанных1.xml is excluded by !src/test/resources/**
  • src/test/resources/metadata/designer/ExternalDataSources/ВнешнийИсточникДанных1/Tables/Таблица1.xml is excluded by !src/test/resources/**
📒 Files selected for processing (1)
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.java: Follow the Style Guide provided in docs/en/contributing/StyleGuide.md
Use Lombok annotations to reduce boilerplate code and enable annotation processing in your IDE
Optimize imports before committing but do NOT optimize imports across the entire project unless specifically working on that task
Follow Java naming conventions with meaningful, descriptive names; keep class and method names concise but clear
Write JavaDoc for public APIs and include comments for complex logic
Use Target Java 17 as the language version

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
**/diagnostics/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Each diagnostic should have a Java implementation class, resource bundle for localized messages, unit tests, and documentation

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
**/diagnostics/*Test.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write comprehensive unit tests for each diagnostic including test cases for edge cases, following existing test patterns

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
**/test/java/**/*.java

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use appropriate test frameworks (JUnit, AssertJ, Mockito) for testing

Files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to docs/*/diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3308
File: src/test/resources/diagnostics/DoubleNegativesDiagnostic.bsl:20-21
Timestamp: 2024-07-04T19:35:26.747Z
Learning: The file `DoubleNegativesDiagnostic.bsl` is a test resource intended to demonstrate the functionality of the DoubleNegatives diagnostic.
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to **/diagnostics/*Test.java : Write comprehensive unit tests for each diagnostic including test cases for edge cases, following existing test patterns
📚 Learning: 2025-11-27T07:17:33.726Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to docs/*/diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
📚 Learning: 2025-11-27T07:17:33.726Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to **/diagnostics/*Test.java : Write comprehensive unit tests for each diagnostic including test cases for edge cases, following existing test patterns

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
📚 Learning: 2025-11-27T07:17:33.726Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to **/diagnostics/*.java : Each diagnostic should have a Java implementation class, resource bundle for localized messages, unit tests, and documentation

Applied to files:

  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Analyse
  • GitHub Check: build
  • GitHub Check: Benchmark
  • GitHub Check: build (17, ubuntu-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (25, windows-latest)
  • GitHub Check: build (17, macOS-latest)
  • GitHub Check: build (17, windows-latest)
  • GitHub Check: build (25, macOS-latest)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (25, ubuntu-latest)
  • GitHub Check: build (21, ubuntu-latest)
🔇 Additional comments (2)
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java (2)

61-69: LGTM!

This test method correctly validates that the diagnostic doesn't raise false positives when no metadata context is available, which is an important edge case.


52-57: Verify test resource file contains expected query references and test metadata does not include "ВнешнийИсточникДанных2".

The test now expects two additional diagnostics for "ВнешнийИсточникДанных.ВнешнийИсточникДанных2" at lines 50 and 66 with column ranges 18-62. Confirm:

  1. The test resource file src/test/resources/diagnostics/QueryToMissingMetadataDiagnostic.bsl contains query statements at lines 50 and 66 referencing the external data source
  2. "ВнешнийИсточникДанных2" is intentionally absent from the test metadata to validate the negative test case
  3. Corresponding positive test cases exist to ensure existing external data sources don't trigger false positives per issue [FP] QueryToMissingMetadata Все ВИДы считаются несуществующими метаданными #2282

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2025

@ovcharenko-di
Copy link
Contributor Author

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Caution

Docstrings generation - FAILED

No docstrings were generated.

@nixel2007 nixel2007 merged commit d81de41 into 1c-syntax:develop Dec 5, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FP] QueryToMissingMetadata Все ВИДы считаются несуществующими метаданными

3 participants